import request from '../utils/request';



export default {
    /**
     * 查询角色列表
     * @param query
     * @returns {AxiosPromise}
     */
    selectList : query => {
        return request({
            url: '/sysUser/select',
            method: 'POST',
            data: query
        });
    },

    /**
     * 查看角色
     * @param query
     * @returns {AxiosPromise}
     */
    selectSysUser : query => {
        return request({
            url: '/sysUser/' + query,
            method: 'POST',
        });
    },


    /**
     * 新增角色
     * @param query
     * @returns {AxiosPromise}
     */
    addSysUser : query => {
        return request({
            url: '/sysUser/insert',
            method: 'POST',
            data: query
        });
    },


    /**
     * 编辑角色
     * @param query
     * @returns {AxiosPromise}
     */
    updateSysUser : query => {
        return request({
            url: '/sysUser/update',
            method: 'POST',
            data: query
        });
    },

    /**
     * 删除角色
     * @param query
     * @returns {AxiosPromise}
     */
    delSysUser : query => {
        return request({
            url: '/sysUser/update',
            method: 'POST',
            data: query
        });
    },

    /**
     * 查看角色
     * @param query
     * @returns {AxiosPromise}
     */
    sysRoleList : query => {
        return request({
            url: '/sysRole/select',
            method: 'POST',
            data: query
        });
    },

    /**
     * 查看用户角色
     * @param query
     * @returns {AxiosPromise}
     */
    getUserRole : query => {
        return request({
            url: '/sysUserRole/' + query,
            method: 'POST',
            data: query
        });
    },

    /**
     *  启用禁用
     * @param query
     * @returns {AxiosPromise}
     */
    enableAndDisable : query => {
        return request({
            url: '/sysUser/enableAndDisable',
            method: 'POST',
            data: query
        });
    }
}
